//
//  MBMusicICell.m
//  MiBaoTu
//
//  Created by mac004 on 2016/10/12.
//  Copyright © 2016年 com.caesartech15. All rights reserved.
//

#import "MBMusicICell.h"

@implementation MBMusicICell
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        [self creatUI];
    }
              return self;
}
-(void)creatUI
{
    self.musicIcon=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.width, self.width)];
    [self.contentView addSubview:self.musicIcon];
    
    self.musicLb=[[UILabel alloc]initWithFrame:CGRectMake(0, self.musicIcon.bottom+30*PERCEN, self.width, 40*PERCEN)];
    self.musicLb.font=[UIFont systemFontOfSize:40*PERCEN];
    self.musicLb.textColor=UIColorFromHex(0x333333);
    self.musicLb.textAlignment=NSTextAlignmentCenter;
   
    [self.contentView addSubview:self.musicLb];
    
}


-(void)setDateDic:(NSMutableDictionary *)dateDic{
    _dateDic=dateDic;
    NSString *imgPath = [_dateDic objectForKey:@"MainPicture"];
    if (![imgPath isKindOfClass:[NSNull class]]) {
        [_musicIcon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",MUSIC_PLAY_Url,imgPath]] placeholderImage:[UIImage imageNamed:@"moren_diantai_4.0"]];
    }else{
        _musicIcon.image=[UIImage imageNamed:@"moren_diantai_4.0"];
    }
    NSString*RadioName;
    if ([_dateDic.allKeys containsObject:@"RadioName"]) {
        RadioName=[NSString stringWithFormat:@"%@",[_dateDic objectForKey:@"RadioName"]];
    }
    else if ([_dateDic.allKeys containsObject:@"RaduiName"]) {
        RadioName=[NSString stringWithFormat:@"%@",[_dateDic objectForKey:@"RaduiName"]];
    }

    
    _musicLb.text=RadioName;
    

}
@end
